﻿using ScreenCapture.Base.Services;
using ScreenCapture.Loc;
using ScreenCapture.Windows.Models;
using System;
using System.Reflection;

namespace ScreenCapture.Core.Models
{
    public class CoreModule : IModule
    {
        public void OnLoad(IBinder MyBinder)
        {
            // 依赖注入功能: 注册IIconSet接口对应的类
            MyBinder.Bind<IIconSet, MeterialDesignIcons>();
            // 在核心模块,加载Windows模块
            WindowsModule.Load(MyBinder);
            MyBinder.Bind<ILocalizationProvider>(() => LanguageManager.Instance);

            // 绑定Settings的各个模块
            BindSettings(MyBinder);
        }

        /// <summary>
        /// 绑定设置相关的各个类对象
        /// </summary>
        /// <param name="MyBinder"></param>
        private void BindSettings(IBinder MyBinder)
        {
            MyBinder.BindSingleton<Settings>();
        }

        public void Dispose() { }
    }
}
